﻿using Abp.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Partner.Surround.Base.DataDictionaries
{
    /// <summary>
    /// 基础_数据字典项
    /// </summary>
    [Table("Base_DataDictionaryItem")]
    public class DataDictionaryItem : Entity<long>, IMustHaveTenant
    {
        public const int MaxCodeLength = 5;
        public const int MaxNameLength = 30;

        /// <summary>
        /// 租户Id
        /// </summary>
        public int TenantId { get; set; }

        /// <summary>
        /// 业务代码
        /// </summary>
        [StringLength(MaxCodeLength)]
        public string Code { get; set; }

        /// <summary>
        /// 类型项名称
        /// </summary>
        [StringLength(MaxNameLength)]
        public string Name { get; set; }

        /// <summary>
        /// 数据字典Id
        /// </summary>
        public long DataDictionaryId { get; set; }

        /// <summary>
        /// 关联数据字典项
        /// </summary>
        public virtual DataDictionary DataDictionary { get; set; }
    }
}
